define(['wx.cookie','wx.ajax','wx.tpl'],function(wx){
	var common = {};

    common.dataTableText = {
        "sProcessing": "处理中...",
        "sLengthMenu": "显示 _MENU_ 项结果",
        "sZeroRecords": "没有匹配结果",
        "sInfo": "显示第 _START_ 至 _END_ 项结果，共 _TOTAL_ 项",
        "sInfoEmpty": "显示第 0 至 0 项结果，共 0 项",
        "sInfoFiltered": "(由 _MAX_ 项结果过滤)",
        "sInfoPostFix": "",
        "sSearch": "搜索:",
        "sUrl": "",
        "sEmptyTable": "表中数据为空",
        "sLoadingRecords": "载入中...",
        "sInfoThousands": ",",
        "oPaginate": {
            "sFirst": "首页",
            "sPrevious": "上页",
            "sNext": "下页",
            "sLast": "末页"
        },
        "oAria": {
            "sSortAscending": ": 以升序排列此列",
            "sSortDescending": ": 以降序排列此列"
        }
    };

    common.init = function(){
        Core.init('[]');
        // $('#Js-main').css('background-image','url(/web/res/images/background1.jpg)');  // 背景图
        $('#Js-showDesk').click(function(){
            Core.showDesktop();
        });
    };

    common.createAce = function(id,callback){
        require(['/web/res/js/vendor/ace/ace.js'],function(){
            $.when(
               $.getScript('/web/res/js/vendor/ace/mode-javascript.js'),
               $.getScript('/web/res/js/vendor/ace/worker-javascript.js'),
               $.getScript('/web/res/js/vendor/ace/ext-language_tools.js'),
               $.getScript('/web/res/js/vendor/ace/theme-monokai.js')
            ).done(function(){
                ace.require("/web/res/js/vendor/ace/ext/language_tools");
                var editor = ace.edit(id);
                editor.setTheme("ace/theme/monokai");
                editor.session.setMode("ace/mode/javascript");
                editor.setOptions({
                    enableBasicAutocompletion: true,
                    enableSnippets: true,
                    enableLiveAutocompletion: true
                });
                if(callback) callback(editor);
            });
        });
    };
    
    return common;
});